package hivetohbase_scala

import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.hbase.HBaseConfiguration
import org.apache.hadoop.hbase.client.{Admin, Connection, ConnectionFactory}

object  HbaseUtils {
  def hbaseConf(hbaseUrl:String)={
    //创建Hbase的配置
    val hbaseConf: Configuration = HBaseConfiguration.create()
    hbaseConf.set("hbase.zookeeper.quorum", hbaseUrl)
    hbaseConf
  }


  def hbaseConnect(hbaseConf: Configuration)={
    //创建hbase的链接，利用默认的配置文件，实际上读取的hbase的master地址
    val hbaseConn: Connection = ConnectionFactory.createConnection(hbaseConf)

    hbaseConn
  }
}
